import { createStore, applyMiddleware, combineReducers } from "redux"
// createStore
import { composeWithDevTools } from "redux-devtools-extension"
// 使用开发者工具
import count from "./count"
import person from "./person"
import thunk from "redux-thunk"
// 引入 redux-thunk ,用于支持异步action

// export const createAsync = (data, time) => {
//   return (dispatch) => {
//     setTimeout(() => {
//       dispatch(createStore(data))
//     }, time)
//   }
// }

// 异步action 不是必须要用的 非必须

export default createStore(
  combineReducers({ count, person }),
  composeWithDevTools(applyMiddleware(thunk))
  // 使用开发者工具
)
